﻿<UserControl x:Class="VmroleAuthor.Views.DeployLandingPageView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d" 
             d:DesignWidth="450"
             KeyboardNavigation.IsTabStop="False">
    <UserControl.Resources>
        
        <Style TargetType="ComboBox"  x:Key="ComboBoxStyle">
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid FocusManager.FocusedElement="{Binding ElementName=SubscriptionId}">
        <Grid.RowDefinitions >
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="*" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="6"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="60"/>
            <ColumnDefinition Width="6"/>
        </Grid.ColumnDefinitions>
        
        <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
            <Grid Grid.Row="2" Grid.Column="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="6"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="1"
                FontSize="14"     
                VerticalAlignment="Center" 
                Text="DEPLOYMENT PROPERTIES"/>
            </Grid>
        </StackPanel>
        <ScrollViewer  Grid.Row="3" Grid.Column="1"  CanContentScroll="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="24" /> <!-- 16 the space before RESOURCE UPLOAD PROPERTIES -->
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" /> <!-- 21 -->
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" /> <!-- 26 -->
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="6"/>
            </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
                    <TextBlock FontSize="12" ToolTip="Specifies the identifier of the Microsoft Azure subscription"
                        FontWeight="Bold"   
                        VerticalAlignment="Center" 
                        Text="SUBSCRIPTION ID " />
                    <Button HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" TabIndex="8">
                        <Button.ToolTip>
                            <TextBlock Text="Specifies the identifier of the Microsoft Azure subscription"/>
                        </Button.ToolTip>
                        <Image Height="20" Width="20" Source="../Img/Help.ico" VerticalAlignment="Center"/>
                    </Button>
                </StackPanel>
                <TextBox Grid.Row="2" Grid.Column="1" Name="SubscriptionId"
                    TabIndex="0" ToolTip="Enter the Microsoft Azure Subscription Id"
                    FontSize="14"     
                    VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24"
                    Text="{Binding Path=SubscriptionId, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>

                <ContentPresenter Grid.Row="3" Grid.Column="1" Content="{Binding ElementName=SubscriptionId, Path=(Validation.Errors).CurrentItem}" />                
               
                <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
                    <TextBlock FontSize="12" ToolTip="Specifies the thumbprint of the management certificate associated with the specified subscription"
                        FontWeight="Bold"     
                        VerticalAlignment="Center" 
                        Text="MANAGEMENT CERTIFICATE THUMBPRINT "/>

                    <Button HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" TabIndex="9">
                        <Button.ToolTip>
                            <TextBlock Text="Specifies the thumbprint of the management certificate associated with the specified subscription"/>
                        </Button.ToolTip>
                        <Image Height="20" Width="20"  Source="../Img/Help.ico" VerticalAlignment="Center"/>
                    </Button>
                </StackPanel>
            
                <TextBox Grid.Row="6" Grid.Column="1" Name="MgtCertThumbprint"
                    TabIndex="1" ToolTip="Enter the Microsoft Azure Management Certificate Thumbprint"
                    FontSize="14"     
                    VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24"
                    Text="{Binding Path=MgtCertThumbprint, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>

                <ContentPresenter Grid.Row="7" Grid.Column="1" Content="{Binding ElementName=MgtCertThumbprint, Path=(Validation.Errors).CurrentItem}" />
            
                <StackPanel Grid.Row="8" Grid.Column="1" Orientation="Horizontal">
                    <TextBlock FontSize="12" ToolTip="Choose the Cloud Service which hosts the virtual machine to which the resource extension will be deployed"
                        FontWeight="Bold"       
                        VerticalAlignment="Center" 
                        Text="CLOUD SERVICE "/>

                    <Button HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" TabIndex="10">
                        <Button.ToolTip>
                            <TextBlock Text="Choose the Cloud Service which hosts the virtual machine to which the resource extension will be deployed"/>
                        </Button.ToolTip>
                        <Image Height="20" Width="20"  Source="../Img/Help.ico" VerticalAlignment="Center"/>
                    </Button>
                </StackPanel>

                <ComboBox Grid.Row="10" Grid.Column="1" Name="CloudService" 
                    TabIndex="2" ToolTip="Select Cloud Service"
                    IsEditable="True" 
                    IsReadOnly="True"
                    Text="Select Cloud Service"
                    FontSize="14"
                    VerticalAlignment="Center" 
                    ItemsSource="{Binding Path=CloudServices, Mode=OneWay}"
                    SelectedItem="{Binding Path=SelectedCloudService, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" 
                    Style="{StaticResource ComboBoxStyle}"
                    Validation.ErrorTemplate="{x:Null}"
                    SelectedIndex="0" 
                    DisplayMemberPath="Name" VerticalContentAlignment="Center" Height="24">
                </ComboBox>

                <ContentPresenter Grid.Row="11" Grid.Column="1" Content="{Binding ElementName=CloudService, Path=(Validation.Errors).CurrentItem}" />
                                          
                <StackPanel Grid.Row="12" Grid.Column="1" Orientation="Horizontal">
                    <TextBlock FontSize="12" ToolTip="Choose the virtual machine (deployment) to which the resource extension will be deployed"
                        FontWeight="Bold"       
                        VerticalAlignment="Center" 
                        Text="VIRTUAL MACHINE (DEPLOYMENT) " />

                    <Button HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" TabIndex="11">
                        <Button.ToolTip>
                            <TextBlock Text="Choose the virtual machine (deployment) to which the resource extension will be deployed"/>
                        </Button.ToolTip>
                        <Image Height="20" Width="20"  Source="../Img/Help.ico" VerticalAlignment="Center"/>
                    </Button>
                </StackPanel>

                <ComboBox Grid.Row="14" Grid.Column="1" Name="VirtualMachine" 
                    TabIndex="3" ToolTip="Select Virtual Machine"
                    IsEditable="True" 
                    IsReadOnly="True"
                    Text="Select Virtual Machine"
                    FontSize="14"     
                    VerticalAlignment="Center" 
                    ItemsSource="{Binding Path=VirtualMachines, Mode=OneWay}"
                    SelectedItem="{Binding Path=SelectedVirtualMachine, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
                    Validation.ErrorTemplate="{x:Null}"
                    DisplayMemberPath="DisplayName"
                    Style="{StaticResource ComboBoxStyle}"
                    SelectedIndex="0" VerticalContentAlignment="Center" Height="24">
                </ComboBox>
                <ContentPresenter  Grid.Row="15" Grid.Column="1" Content="{Binding ElementName=VirtualMachine, Path=(Validation.Errors).CurrentItem}" />
                        
            
                <StackPanel Grid.Row="17" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding Path=PayloadVisibility}">
                    <TextBlock FontSize="14"     
                        VerticalAlignment="Center" 
                        Text="RESOURCE UPLOAD PROPERTIES" />
                    
                </StackPanel>

                <StackPanel Grid.Row="19" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding Path=PayloadVisibility}">
                    <TextBlock FontSize="12" ToolTip="Choose the Storage Account to which required resource extension payload will be uploaded"
                        FontWeight="Bold"       
                        VerticalAlignment="Center" 
                        Text="STORAGE ACCOUNT " />

                    <Button HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" TabIndex="12">
                        <Button.ToolTip>
                            <TextBlock Text="Choose the Storage Account to which required resource extension payload will be uploaded"/>
                        </Button.ToolTip>
                        <Image Height="20" Width="20"  Source="../Img/Help.ico" VerticalAlignment="Center"/>
                    </Button>
                </StackPanel>
                
                <ComboBox Grid.Row="21" Grid.Column="1" Name="StorageAccount" Visibility="{Binding Path=PayloadVisibility}"
                    TabIndex="4" ToolTip="Select Storage Account"
                    IsEditable="True" 
                    IsReadOnly="True"
                    Text="Select Storage Account"
                    FontSize="14"     
                    VerticalAlignment="Center" 
                    ItemsSource="{Binding Path=CloudStorageAccounts}"
                    SelectedItem="{Binding Path=SelectedStorageAccount, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
                    Validation.ErrorTemplate="{x:Null}"
                    DisplayMemberPath="Name"
                    Style="{StaticResource ComboBoxStyle}"
                    SelectedIndex="0" VerticalContentAlignment="Center" Height="24">
                </ComboBox>

                <ContentPresenter  Grid.Row="22" Grid.Column="1" Content="{Binding ElementName=StorageAccount, Path=(Validation.Errors).CurrentItem}" />             
            
                <StackPanel Grid.Row="23" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding Path=PayloadVisibility}">
                    <TextBlock FontSize="12" ToolTip="Choose the container in which to upload required resource extension payload"
                        FontWeight="Bold"       
                        VerticalAlignment="Center" 
                        Text="STORAGE ACCOUNT CONTAINER " />

                    <Button HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent" TabIndex="13">
                        <Button.ToolTip>
                            <TextBlock Text="Choose the container in which to upload required resource extension payload"/>
                        </Button.ToolTip>
                        <Image Height="20" Width="20"  Source="../Img/Help.ico" VerticalAlignment="Center"/>
                    </Button>
                </StackPanel>

                <ComboBox Grid.Row="25" Grid.Column="1" Name="StorageContainer" Visibility="{Binding Path=PayloadVisibility}"
                    TabIndex="5" ToolTip="Select Storage Container"
                    IsEditable="True" 
                    IsReadOnly="True"
                    Text="Select Storage Container"
                    FontSize="14"     
                    VerticalAlignment="Center" 
                    ItemsSource="{Binding Path=CloudStorageContainers}"
                    SelectedItem="{Binding Path=SelectedStorageContainer, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
                    DisplayMemberPath="Name"
                    Validation.ErrorTemplate="{x:Null}"
                    Style="{StaticResource ComboBoxStyle}"
                    SelectedIndex="0" VerticalContentAlignment="Center" Height="24">
                </ComboBox>

                <ContentPresenter  Grid.Row="26" Grid.Column="1" Content="{Binding ElementName=StorageContainer, Path=(Validation.Errors).CurrentItem}" />                         
            
                <StackPanel Grid.Row="28" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding Path=PayloadVisibility}">
                    <CheckBox Name="ResourcesUploaded"
                        TabIndex="6" ToolTip="Checkbox for Required resources have already been uploaded"
                        IsChecked="{Binding AreResourcesUploaded, Mode=TwoWay}"/>
                    <TextBlock FontSize="12"      
                            VerticalAlignment="Center" 
                            Text=" Required resources have already been uploaded" /> 
                </StackPanel>

                <StackPanel Grid.Row="30" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding Path=PayloadVisibility}">
                    <CheckBox Name="DeleteResources"
                        TabIndex="7" ToolTip="Checkbox for Delete payload from storage account after deployment"
                        IsChecked="{Binding DeleteResourcesAfterDeployment, Mode=TwoWay}"/>
                    <TextBlock FontSize="12"      
                            VerticalAlignment="Center" 
                            Text=" Delete payload from storage account after deployment" />
                </StackPanel>
                
            </Grid>
        </ScrollViewer>
        
        <StackPanel Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" Visibility="{Binding Path=WaitMessageVisibility}">
            <Image Height="20" Width="20"  Source="../Img/pending.png" VerticalAlignment="Center"/>
            <TextBlock FontSize="14" FontWeight="Normal"       
                VerticalAlignment="Center" 
                Foreground="{x:Static SystemColors.HotTrackBrush}"
                Text="{Binding Path=WaitMessage}"/>
        </StackPanel>
    </Grid>
</UserControl>
